package lol.clann.minecraft.springboot.remap.context;

import lol.clann.minecraft.springboot.bukkit.plugin.AdapterContext;

import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author pyz
 * @date 2019/7/11 10:33 PM
 */
public class RemapContext {
    public static boolean enableNMSRemap = AdapterContext.getRemappingResource() != null;
    /**
     * 需要remap的类
     */
    private static final Set<String> remapClasses = new HashSet<>();
    public static boolean printRemapPluginClass = false;
    public static boolean dumpRemapPluginClass = false;

    /**
     * 注册需要remap的类
     *
     * @param className
     */
    public static void registerRemapClasses(String className) {
        remapClasses.add(className);
    }

    public static boolean shouldRemap(String className) {
        if (className.startsWith("lol.clann.minecraft.springboot")) {
            return true;
        }
        return remapClasses.contains(className);
    }
}
